<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动属性</title>
    <style>
        *{margin: 0;
         padding: 0;
        }
        .container{border: 1px solid red;
            width: 300px;
            clear: none
        }
        #box1 {
            background-color: aquamarine;
            float: left;
            width: 100px;
            height: 100px
        }
        #box2{background-color: darkorchid;
        float: right;
        width: 100px;
        height: 100px;
        }

        #box3{background-color: blue;
        height: 50px;
        }

        .clearfix:after{
            content: "";
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
<div class="container clearfix">
    <div id="box1">box1 向左飘</div>
    <div id="box2">box2 向右飘</div>
    <!--<div style="clear: both"></div>-->
    <!--清除上下的浮动-->
</div>
<div id="box3">box3 在底部</div>

</body>
</html>